package com.dayuanit.atm.mapper;

import com.dayuanit.atm.entity.Card;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CardMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Card record);

    int insertSelective(Card record);

    Card selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Card record);

    int updateByPrimaryKey(Card record);

    int countCardByNum(@Param("cardNum") String cardNum);

    Card getCard(String cardNum);

    int changeBalance(@Param("cardId") Integer cardId,
                      @Param("oldVersion") Integer oldVersion,
                      @Param("balance") String balance);

    List<Card> listCards(@Param("userId") Integer userId);

    Card getCard4Lock(String cardNum);
}